/*
WLVGoogleImageSelector - Google Picasa Web Plugin for Windows Live Writer
Copyright (C) 2007 Timothy Parez

This program is free software; you can redistribute it and/or
modify it under the terms of the GNU General Public License
as published by the Free Software Foundation; either version 2
of the License, or (at your option) any later version.

This program is distributed in the hope that it will be useful,
but WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
GNU General Public License for more details.

You should have received a copy of the GNU General Public License
along with this program; if not, write to the Free Software
Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA  02110-1301, USA.
*/

using System;
using System.Windows.Forms;
using System.Collections.Generic;
using System.Text;
using WindowsLive.Writer.Api;
namespace Arendee.WindowsLiveWriter.Plugins
{
    [WriterPlugin("3c55ac13-8bd3-2d21-3689-e4d1a5c34e1a", "WLWGoogleImageSelector",HasEditableOptions=true)]
    [InsertableContentSourceAttribute("Google Image")]
    public class WLWGoogleImageSelector : SmartContentSource
    {
        

        public string DefaultGoogleId
        {
            set
            {
                this.Options.SetString("DefaultGoogleId", value);
            }
            get
            {
                return this.Options.GetString("DefaultGoogleId", "");
            }
        }

        public WLWGoogleImageSelector()
        {
            
        }

        public override DialogResult CreateContent(IWin32Window dialogOwner, ISmartContent newContent)
        {
            return DialogResult.OK;
        }


        public override string GeneratePublishHtml(ISmartContent content, IPublishingContext publishingContext)
        {
            return content.Properties.GetString("body", "<img src=\"\"/>");
        }

        public override string GenerateEditorHtml(ISmartContent content, IPublishingContext publishingContext)
        {
           return content.Properties.GetString("body", "<img src=\"\"/>");
        }

        public override SmartContentEditor CreateEditor(ISmartContentEditorSite editorSite)
        {
            return new GoogleImageSelectorEditor(this.Options);
        }       

        public override void EditOptions(IWin32Window dialogOwner)
        {
            //base.EditOptions(dialogOwner);
            GoogleImageSelectorOptionsForm optionsForm = new GoogleImageSelectorOptionsForm(this.Options);
            optionsForm.ShowDialog(dialogOwner);
        }
    }
}